<div class="content-auto">
<div class="breadcrumb">
<?php
if($cat == 3)
    echo '<span>(<strong>Inventory</strong>=== FA)</span>';
else
    echo '<span>(<strong>Inventory</strong>=== NA)</span>';
?>
</div>
<?php echo form_open('inventory/assetadd',array('class'=>'form-horizontal form-validate','id'=>'frm'));?>
<fieldset>
    <legend><h4><?php echo $title;?></h4></legend>
    <table class="table-form-submit">
        <tr>
    <?php
       if($cat == 3){
           echo '<td><label for="item">FA Type</label></td>';
           echo '<td>'.form_dropdown('fatype_id', $faList,array(), 'class="form-control fa-select"').'</td>';
       }
       elseif($cat == 4)
       {
           echo '<td><label for="item">NA Type</label></td>';
           echo '<td>'.form_dropdown('natype_id', $naList,array(), 'class="form-control na-select"').'</td>';
       }
    ?>
        </tr>
        <tr>
            <td><label for="item">Item *</label></td>
            <td><input type="text" name="item" placeholder="item name" class="form-control" required /></td>
        </tr>
        <tr>
            <td><label for="code">Code</label></td>
            <td><input type="text" name="code" placeholder="code item" class="form-control control-width" /></td>
        </tr>
         <tr>
            <td><label for="unit">Unit *</label></td>
            <td>
                <input type="text" name="unit" placeholder="number of items" class="form-control control-width" required />
            </td>
        </tr>
        <tr>
            <td><label for="cpu">Cost Per Unit *</td>
            <td><input type="text" name="cpu" placeholder="cost per unit" class="form-control control-width" required /></td>
        </tr>
        <tr>
            <td><label for="datepurchased">Purchased Date *</td>
            <td><input type="text" name="datepurchased" placeholder="purchased date" data-date-format="yyyy/mm/dd" class="form-control datepicker" required /></td>
        </tr>
        <tr>
            <td><label for="status_id">Status</label></td>
            <td>
                <?php echo form_dropdown('status_id', $statusList,array(), 'class="form-control status-select"') ?>
            </td>
        </tr>
        <tr class="hidden-branch-tr">
            <td><label class="branch-hidden"  for="note">Note</td>
            <td><textarea name="note" class="form-control branch-hidden note"></textarea></td>
        </tr>
        <tr class="hidden-broken-tr">
            <td><label class="broken-hidden"  for="notebroken">Note</td>
            <td><textarea name="notebroken" class="form-control broken-hidden note"></textarea></td>
        </tr>
        <tr class="hidden-branch-tr">
            <td><label  class="branch-hidden" for="dateused">Date </td>
            <td><input type="text" name="dateused" placeholder="used or transfered date" data-date-format="yyyy/mm/dd" class="form-control branch-hidden datepicker" /></td>
        </tr>
        <tr class="hidden-branch-tr">
            <td><label class="branch-hidden" for="unitused">Unit *</label></td>
            <td><input type="text" name="unitused" placeholder="number of items" class="form-control control-width branch-hidden" required /></td>
        </tr>
    <?php if(isset($_SESSION['branch']) && $_SESSION['branch'] == '00HO00') { ?>
        <tr class="hidden-branch-tr">
            <td><label  class="branch-hidden" for="branch_id">Office *</label></td>
            <td>
                <?php echo form_dropdown('branch_id', $branchList,array(), 'class="form-control branch-hidden" id="branch_id" required') ?>
            </td>
        </tr>
         <tr class="hidden-branch-tr location-tr">
            <td><label  class="branch-hidden" for="location_id">Location</label></td>
            <td>
                <?php echo form_dropdown('location_id', $locationList,array(), 'class="form-control branch-hidden" id="location_id"') ?>
            </td>
        </tr>
    <?php } else {
        echo form_hidden('branch_id', $_SESSION['branch']);
    }?>
        <tr class="hidden-branch-tr">
            <td><label class="branch-hidden" for="staff">Staff</label></td>
            <td><input type="text" name="staff" placeholder="Staff name" class="form-control control-width branch-hidden" /></td>
        </tr>
        <tr class="hidden-broken-tr type-tr">
            <td><label class="broken-hidden" for="unitbroken">Unit</label></td>
            <td><input type="text" name="unitbroken" placeholder="Number of items" class="form-control control-width broken-hidden" /></td>     
        </tr>
        <tr>
            <td><label for="remark">Remark</td>
            <td><textarea name="remark" class="form-control"></textarea></td>
        </tr>
        <tr>
            <td></td>
            <td>
                <label class="checkbox">
                    <input name="activate" type="checkbox" checked="checked" /> Active
                </label>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <?php 
                    echo form_hidden('category_id',$cat);
                ?>
                <?php echo $form; ?>
            </td>
        </tr>
    </table>
 </fieldset> 
<?php echo form_close();?>
</div>